home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2004 #2 / Amiga Plus CD - 2004 - No. 02.iso / AmigaPlus / Tools / Development / RxMUI / Examples / PopO.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  2004-01-31  |  2.2 KB  |  71 lines

  1. /* How to create and handle a Popobject */
  2.  
  3. signal on halt
  4. signal on break_c
  5.  
  6. call Init
  7. call CreateApp
  8. call HandleApp
  9. /* never reached */
  10. /***********************************************************************/
  11. Init: procedure
  12.     l="rmh.library";if ~show("L",l) then;if ~addlib(l,0,-30) then exit
  13.     if AddLibrary("rexxsupport.library","rxmui.library")~=0 then exit
  14.     call RxMUIOpt("DebugMode ShowErr")
  15.     return
  16. /***********************************************************************/
  17. HandleApp: procedure
  18.     ctrl_c=2**12
  19.     do forever
  20.         call NewHandle("app","h",ctrl_c)
  21.         if and(h.signals,ctrl_c)>0 then exit
  22.         select
  23.             when h.event="QUIT" then exit
  24.             otherwise interpret h.event
  25.         end
  26.     end
  27.     /* never reached */
  28. /***********************************************************************/
  29. CreateApp: procedure
  30.  
  31.     app.Title="PopObject"
  32.     app.Version="$VER: PopObject 1.1 (5.10.2001)"
  33.     app.Copyright="Copyrifht 2001 by Alfonso Ranieri"
  34.     app.Author="Alfonso Ranieri"
  35.     app.Description="PopObjectExample"
  36.     app.Base="RXMUIEXAMPLE"
  37.     app.SubWindow="mwin"
  38.      mwin.Title="PopObjectExample"
  39.      mwin.ID="MAIN"
  40.      mwin.Contents="mgroup"
  41.       mgroup.0="po"
  42.        po.Class="Popobject"
  43.        po.Object="pg"
  44.         pg.Class="group"
  45.         pg.Frame="Inputlist"
  46.          pg.0="Lv"
  47.           lv.Class="Listview"
  48.           lv.list="l"
  49.          pg.1=Button("closepo","Close")
  50.        po.String=String("S")
  51.        po.Button=MakeObj("","Imagebutton","popup")
  52.        po.Toggle=1
  53.        po.OpenFun="call DoMethod('l','clear');call set('l','quiet',1);pl=show('p',,'/');do while pl~='';parse var pl p '/' pl;call domethod('l','insert',p,'sorted');end;call set('l','quiet',0);return 1"
  54.        po.CloseFun="call DoMethod('l','GetEntry','active','A');call set('s','contents',a)"
  55.  
  56.     call NewObj("application","app")
  57.  
  58.     call Notify("mwin","CloseRequest",1,"app","ReturnID","quit")
  59.     call Notify("lv","DoubleClick","EveryTime","po","Close",1)
  60.     call Notify("closepo","Pressed",0,"po","Close")
  61.  
  62.     call set("mwin","open",1)
  63.  
  64.     return
  65. /***********************************************************************/
  66. halt:
  67. break_c:
  68.     exit
  69. /**************************************************************************/
  70.  
  71.